var root = ui("$");
var helperOpen = require("helper/open");
var app = sm("do_App");
var external = sm("do_External");
root.setMapping({
	"imgbfs.tag" : "path",
	"do_ImageView_img.source" : "imgs",
	"do_ImageView_img.tag" : "jsonData",
	"do_Label_href.tag" : "href"
});
var nf = sm("do_Notification");
var bgimg = ui("imgbfs");
var img = ui("do_ImageView_img");
var href = ui("do_Label_href")
bgimg.on("touch", function() {
	var getPath = bgimg.tag;
	var jsonData = img.tag;
	var getHref = href.tag;
	if (getPath) {
		if (jsonData) {
			helperOpen.open(getPath,JSON.parse(jsonData));
		} else {
			helperOpen.open(getPath);
		}
	} else {
		if (getHref) {
			if (getHref.indexOf("http://") < 0) {
				getHref = "http://" + getHref;
			}
			external.openURL(getHref);
		}
	}
});